<template>
  <div id="centreRight1">
    <h2 class="text-center mb-2" style="color: white; margin-top: -0.2rem;">敏感评论</h2>
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span style="color:#5cd9e8">
          <icon name="chart-line"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2">任务完成排行榜</span>
        </div>
      </div>
      <div class="d-flex jc-center body-box">
        <dv-scroll-board :config="config" style="width:100%;height:3.7rem" ref="scrollBord" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      config: {
        header: ["发布时间", "平台", "信息"],
        data: [
          [" ", " ", "<span  class='colorGrass'>    </span>"]
        ],
        rowNum: 7, //表格行数
        headerHeight: 35,
        headerBGC: "#0f1325", //表头
        oddRowBGC: "#0f1325", //奇数行
        evenRowBGC: "#171c33", //偶数行
        index: true,
        columnWidth: [50],
        align: ["left"]
      }
    };
  },
  components: {},
  mounted() {
    this.fetchList()
  },
  methods: {
    async fetchList(){
      const response = await this.$http.get("metrics/top5-negative-posts")
      if (response.status == 200) {
        const list = response.data
        this.config.data = list.map(item => [item.commentTime,item.sourceName,item.title])
        this.$refs['scrollBord'].updateRows(this.config.data)
      }
    },

    updateData(){

    },
  }
};
</script>

<style lang="scss">
#centreRight1 {
  padding: 0.2rem;
  // height: 5.125rem;
  // min-width: 3.75rem;
  // border-radius: 0.0625rem;
  width: 100%;
  .bg-color-black {
    width: 100%;

    // height: 4.8125rem;
    // border-radius: 0.125rem;
  }
  .text {
    color: #e3e9f6;
  }
  .body-box {
    border-radius: 0.125rem;
    overflow: hidden;
  }
}
</style>